﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls.WebParts;
//using AccessChecker2010.Properties;
using System.ComponentModel;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;

namespace AccessChecker2010
{
    /// <summary>
    /// Locallized version of the CategoryAttribute
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
    public sealed class LocalizedCategoryAttribute : CategoryAttribute
    {
        /// <summary>
        /// Initializes a new instance of the LocalizedCategoryAttribute class.
        /// </summary>
        public LocalizedCategoryAttribute(string category)
            : base(category)
        {
        }


        protected override string GetLocalizedString(string value)
        {
            return SPUtility.GetLocalizedString("$Resources:AccessChecker2010.Resources," + value, "AccessChecker2010.Resources", SPContext.Current.Web.Language);
                //Resources.Resources.ResourceManager.GetString(value, Resources.Resources.Culture);
        }

    }

}